<layout name='layout/main' />

<header class="am-header am-header-default">
	<div class="am-header-left am-header-nav">
	<a href="<{:U('Index/index')}>"><i class="am-header-icon am-icon-home"></i></a>
	</div>
	<h1 class="am-header-title">我的地址</h1>
	<div class="am-header-right am-header-nav">
	<a href="javascript:window.history.go(-1)"><i class="am-header-icon am-icon-reply"></i></a>
	</div>
</header>

<section class="accounts">
	<div class="myaddress">
		<volist name="list" id="vo"> <p 
			<eq name="vo.def" value="1">class="item_defalut"</eq>
			><{$vo.province}> <{$vo.city}> <{$vo.area}> <{$vo.address}><br>
			<{$vo.name}>, <{$vo.mobile}> <span><a href="<{:U('Store/order',array('addID'=>$vo['id']))}>">选择</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="<{:U('Address/setDefault',array('id'=>$vo['id']))}>">设为默认</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="<{:U('Address/del',array('id'=>$vo['id']))}>" onClick="return confirm('确实删除选定的信息？')">删除</a></span>
			</p>
		</volist>
		<p>
			<button class="am-btn am-btn-danger am-btn-sm" id="add_btn">添加收货地址</a></button>
	</div>
	<script type="text/javascript">
    $(function(){
    	$("#add_btn").bind('click',function(){
    		if ($("#add_address").is(":hidden")) {
    			$("#add_address").slideDown(100);
    		}else{
    			$("#add_address").slideUp(100);
    		}    		
    	})

    	$("#cancel_btn").bind('click',function(){
    		$("#add_address").slideUp(100);  		
    	})
    })
    </script> 
	<div class="myaddress" id="add_address" 
	<empty name="list">style="display:block"</empty>
	>
	<div class="hd">请仔细填写收货地址</div>
	<form action="<{:U('Address/save')}>" method="post" class="ajax am-form address-form" id="doc-vld-msg">
		<div class="am-form-group">
			<label>收货人</label>
			<input type="text" name="name" id="name" class="am-input-sm" placeholder="必填" required/>
		</div>
		<div class="am-form-group">
			<label>手机号码</label>
			<input type="text" name="mobile" id="mobile" class="js-pattern-mobile am-input-sm" placeholder="必填" required/>
		</div>
		<div class="am-form-group">
			<label>地区</label>
			<script src="<{:RES}>/js/diqu.js" type="text/javascript" charset="utf-8"></script>
			<div class="selectBox">
				<select name="province">
				</select>
				<select name="city">
				</select>
				<select name="area">
				</select>
			</div>
			<script language="javascript" defer>new PCAS("province","city","area");</script> 
		</div>
		<div class="am-form-group">
			<label>详细地址</label>
			<input type="text" name="address" id="address" class="am-input-sm" placeholder="必填" required/>
		</div>
		<div class="am-form-group">
			<input type="submit" class="am-btn am-btn-danger am-btn-sm" value="保存">
			<input type="button" class="am-btn am-btn-default am-btn-sm" id="cancel_btn" value="取消">
			<input type="hidden" name="memberID" value="<{$_user['memberID']}>">
		</div>
	</form>
	</div>
</section>
